package com.mtao.mapper;


import com.mtao.entity.SysUser;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;

import java.util.List;

@Mapper
public interface SysUserMapper {
    @Select("select id,email,username,password,create_time,enabled,nick_name,update_time,img from sys_user where id=#{id}")
    SysUser getUser(Integer id);

    @Select("select id,user,remark from  user")
    SysUser findUser(String text);
    @Select("select * from  sys_user")
    List<SysUser> getUserList();

    @Select("select * from sys_user where username=#{username}")
    SysUser fimdName(String username);

    @Insert("insert into sys_user(username, password,nick_name,email,create_time,update_time,enabled,img)" +
            "values (#{username},#{password},#{nickName},#{email},#{createTime},#{updateTime},#{enabled},#{img})")
    void create(SysUser sysUser);

}
